home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
A-Monthly Disks
/
(c)aai.d64
/
war rescue
(
.txt
)
< prev
Wrap
Commodore BASIC
|
2007-02-04
|
7KB
|
240 lines
100 REM ***************************
110 REM * WAR RESCUE *
120 REM * *
130 REM * HOWARD CAMPBELL *
132 REM * 3463 PIPER DRIVE *
134 REM * NORTHWOOD, OHIO *
136 REM * 43619 *
140 REM ***************************
150 :
160 :
170 :
180 REM //////////////////
190 REM / INITIALIZATION /
200 REM //////////////////
210 :
220 POKE53281,14:POKE53280,14:POKE646,0
230 PRINT"[147]"SPC(15)"WAR RESCUE":PRINTSPC(52)"BY HOWARD CAMPBELL"
240 POKE53270,PEEK(53270)AND247
250 PRINT" WAIT A MOMENT...."
260 PRINT""SPC(7)"PLACE JOYSTICK IN PORT 2"
270 V=53248 : REM V=VICII STARTING ADDRESS
280 S=54272 : REM S=SID STARTING ADDRESS
290 FORI=STOS+24:POKEI,0:NEXT : REM CLEAR SID
300 FORI=1009TO1012:READA:POKEI,A:NEXT: REM SPRITE TABLE
310 DATA192,193,194,195
320 HM$=CHR$(19)
330 CR$=CHR$(13):LF$="":FORI=1TO24:LF$=LF$+CR$:NEXTI
340 CK=0:TK=CK:FORI=0TO383:READA:POKEI+12288,AAND255
350 POKE53280,CK:TK=TK+A:CK=CK+1
360 IFCK=8THENGOSUB2400
370 NEXTI
380 CK=0:TK=CK:FORI=828TO853+6:READA:POKEI,AAND255
390 POKE53280,CK:TK=TK+A:CK=CK+1
400 IFCK=8THENGOSUB2400
410 NEXTI
420 CK=0:TK=CK:FORI=49152TO49408+7:READA:POKEI,AAND255
430 POKE53280,CK:TK=TK+A:CK=CK+1
440 IFCK=8THENGOSUB2400
450 NEXTI
460 POKE1008,230:POKE1007,65:POKE1006,0
470 POKES+1,8 : POKES+6,240 : POKES+24,15 : REM CHOPPER SOUND
480 POKES+12,160:POKES+13,252:POKES+8,1:POKES+7,40: REM EXPLOSION
490 POKEV+39,10 : REM SET SPRITE 0 COLOR
500 POKEV+40,0 : REM SET SPRITE 1 COLOR
510 POKEV+37,1 : REM MULTI-COLOR 1
520 POKEV+38,0 : REM MULTI-COLOR 2
530 POKEV+29,1 : REM EXPAND SPRITE 0 IN X DIRECTION
540 POKEV+27,1 : REM SPRITE PRIORITY
550 POKEV+28,1 : REM SET SPRITE 0 TO MULTI-COLOR
560 POKEV+1,65 : POKEV,255 : POKEV+16,0: REM SET SPRITE 0 POSITIONS
570 POKEV+2,255 : POKEV+3,214 : REM SET SPRITE 1 POSITIONS
580 POKE2041,197 : REM POINT SPRITE 1 DATA POINTER
590 POKE53281,9:PRINTCHR$(147);:POKE53281,14:POKE53280,9 : REM FILL COLOR SCREEN
600 FORI=1984TO2023:POKEI,160:NEXTI
610 FT=0:FL=0
620 A=PEEK(V+31) : REM CLEAR SPR/CHR COLLISION REGISTER
630 A=PEEK(V+30) : REM CLEAR SPR/SPR COLLISION REGISTER
640 POKEV+21,3 : REM TURN ON SPRITES
650 SYS 828 : REM START IRQ WEDGE
660 A=0
670 :
680 REM ////////////////
690 REM / MAIN ROUTINE /
700 REM ////////////////
710 :
720 POKES+4,129:POKE2041,197:POKEV+3,225
730 IFRND(.)<.05THENGOSUB920
740 POKES+4,128:POKE56333,127
750 ONAGOSUB880,890,900
760 A=INT(RND(.)*10+1):POKE56333,129
770 POKE1184+40*INT(RND(.)*15),42
780 POKES+11,129:POKES+4,129
790 POKE2041,196:POKEV+3,223
800 POKE1007,PEEK(1007)+1
810 FT=FT+1:PRINTHM$;"[144] FEET:"FT;TAB(20)"FUEL: [157][157][157][157]"200-PEEK(1007)"[149]"
820 POKES+4,128:POKES+11,128
830 C1=PEEK(V+31)AND1:IFC1<>.THENGOSUB990:GOSUB1290:GOTO460
840 C2=PEEK(V+30):IFC2<>.THENGOSUB1150
850 GOTO720
860 END
870 :
880 PRINTLEFT$(LF$,20)"[149][169] [223]"CR$" "CR$" [166] "CR$"[149] ":A=10:RETURN
890 PRINTLEFT$(LF$,21)"[153]#":PRINT"[149][194]":PRINT" ":RETURN
900 PRINTLEFT$(LF$,20)"[153] /"CR$"[153][185] [146][185]"CR$"[155][215][215][215][215]"CR$"[149] ":A=10:RETURN
910 :
920 Y=RND(.)*200+50:SE=10:IFPEEK(V+2)>YTHENSE=-10
930 FORI=PEEK(V+2)TOYSTEPSE:POKEV+2,I:POKE2041,197:POKE2041,196:NEXTI:RETURN
940 :
950 REM /////////////////////
960 REM / SPR/CHR COLLISION /
970 REM /////////////////////
980 :
990 POKE2040,1
1000 POKEV+21,1
1010 POKES+11,128:POKES+11,17
1020 POKE2040,194 : A=255
1030 FORI=PEEK(V+1)TO236:POKEV+1,I:POKES+8,A:A=A-1:NEXTI
1040 SYS 841
1050 POKE2040,10
1060 POKES+4,128:POKES+11,16:POKES+8,1
1070 POKES+11,129
1080 FORI=1TO10STEP.5:POKE2040,I:NEXT:POKES+11,128
1090 RETURN
1100 :
1110 REM /////////////////////
1120 REM / SPR/SPR COLLISION /
1130 REM /////////////////////
1140 :
1150 POKE1007,60:POKEV+3,PEEK(V+1)-3
1160 POKES+1,200:POKES,255:POKES+4,33
1170 FORJ=200TO255STEP5:POKES+1,J:NEXTJ
1180 POKEV+21,1
1190 C2=PEEK(V+30)
1200 POKES+1,8:POKES+4,32:POKES,0
1210 POKEV+1,65:POKEV+2,RND(.)*200+50
1220 POKEV+21,3
1230 RETURN
1240 :
1250 REM /////////
1260 REM / RESET /
1270 REM /////////
1280 :
1290 FORI=1024TO1263:POKEI,32:NEXTI
1300 PRINT"DISTANCE TRAVELED:"FT"FEET"
1310 IFFT>MXTHENMX=FT
1320 POKE53270,PEEK(53270)OR8
1330 PRINT"RECORD DISTANCE :"MX"FEET"
1340 PRINT"[144]WOULD YOU LIKE TO TRY AGAIN?"
1350 PRINT"PRESS THE FIRE BUTTON TO CONTINUE"
1360 PRINT"PRESS ANY KEY TO QUIT"
1370 A=PEEK(56320)AND16
1380 GETA$:IFA$<>""THENEND
1390 IFA<>.THEN1370
1400 POKE53270,PEEK(53270)AND247
1410 RETURN
1420 :
1430 REM ///////////////
1440 REM / SPRITE DATA /
1450 REM ///////////////
1460 :
1470 :
1480 DATA000,000,000,000,000,000,000,000,000
1490 DATA000,085,085,064,000,192,000,002,428
1500 DATA224,000,015,252,006,031,247,011,786
1510 DATA095,245,253,095,245,255,095,247,1530
1520 DATA000,255,252,000,003,000,000,195,705
1530 DATA000,000,063,252,000,000,000,000,315
1540 DATA000,000,000,000,000,000,000,000,000
1550 DATA000,000,000,000,000,000,000,000,000
1560 :
1570 DATA000,000,000,000,000,000,000,000,000
1580 DATA000,000,064,000,000,192,000,000,256
1590 DATA192,000,015,252,001,031,247,003,741
1600 DATA095,245,247,095,245,255,095,247,1524
1610 DATA000,255,252,000,003,000,000,195,705
1620 DATA000,000,063,252,000,000,000,000,315
1630 DATA000,000,000,000,000,000,000,000,000
1640 DATA000,000,000,000,000,000,000,000,000
1650 :
1660 DATA000,000,000,000,000,000,000,000,000
1670 DATA000,085,085,064,000,192,000,000,426
1680 DATA192,000,015,252,004,031,247,003,744
1690 DATA095,245,253,095,245,255,095,247,1530
1700 DATA000,255,252,000,003,000,000,195,705
1710 DATA000,000,063,252,000,000,000,000,315
1720 DATA000,000,000,000,000,000,000,000,000
1730 DATA000,000,000,000,000,000,000,000,000
1740 :
1750 DATA000,000,000,000,000,000,000,000,000
1760 DATA000,000,064,000,000,192,000,002,258
1770 DATA224,000,015,252,002,031,247,011,782
1780 DATA095,245,247,095,245,255,095,247,1524
1790 DATA000,255,252,000,003,000,000,195,705
1800 DATA000,000,063,252,000,000,000,000,315
1810 DATA000,000,000,000,000,000,000,000,000
1820 DATA000,000,000,000,000,000,000,000,000
1830 :
1840 DATA000,000,000,000,000,000,000,000,000
1850 DATA000,000,000,000,000,000,000,000,000
1860 DATA000,000,000,000,000,000,000,000,000
1870 DATA000,096,000,000,096,000,000,016,208
1880 DATA000,000,024,000,000,052,000,000,076
1890 DATA088,000,000,144,000,000,040,000,272
1900 DATA000,072,000,000,140,000,001,132,345
1910 DATA000,000,000,000,000,000,000,000,000
1920 :
1930 DATA000,000,000,000,000,000,000,000,000
1940 DATA000,000,000,000,000,000,000,000,000
1950 DATA000,000,000,000,000,000,000,000,000
1960 DATA000,048,000,000,048,000,000,016,112
1970 DATA000,000,024,000,000,176,000,000,200
1980 DATA112,000,000,016,000,000,016,000,144
1990 DATA000,016,000,000,016,000,000,016,048
2000 DATA000,000,048,000,000,000,000,000,048
2010 :
2020 DATA120,169,0,141,20,3,169,192,814,141
2030 DATA21,3,88,96,120,169,49,687,141,20,3
2040 DATA169,234,141,21,3,732,88,96,0,0,0,0,0,0,184
2050 :
2060 DATA173,0,220,74,176,3,206,1,853,208,74
2070 DATA176,3,238,1,208,74,982,176,42,173
2080 DATA0,208,208,31,173,1011,16,208,41,1,208
2090 DATA16,173,16,679,208,9,1,141,16,208,169
2100 DATA80,832,141,0,208,76,106,192,173,16,912
2110 DATA208,41,252,141,16,208,206,0,1072,208
2120 DATA76,106,192,74,176,32,238,1102,0,208
2130 DATA240,30,169,80,205,0,932,208,208,20
2140 DATA173,16,208,41,1,875,240,13,173,16
2150 DATA208,41,252,141,1084,16,208,169,0,141
2160 DATA0,208,76,818,106,192,173,16,208,9
2170 DATA1,141,846,16,208,173,238,3,24,105
2180 DATA1,768,201,4,208,2,169,0,141,238,963,3
2190 DATA170,189,241,3,141,248,7,1002,224,2
2200 DATA208,10,169,129,141,4,887,212,169,128
2210 DATA141,4,212,173,239,1278,3,205,1,208
2220 DATA144,3,141,1,706,208,173,237,3,24,105
2230 DATA1,41,792,3,141,237,3,201,0,240,3,828,76
2240 DATA49,234,169,40,133,253,169,1123,4,133
2250 DATA254,169,40,133,251,169,1153,216,133
2260 DATA252,32,231,192,165,253,1474,24,105
2270 DATA40,133,253,165,254,105,1079,0,133,254
2280 DATA165,251,24,105,40,972,133,251,165
2290 DATA252,105,0,133,252,1291,165,253,201
2300 DATA192,208,221,165,254,1659,201,7,208
2310 DATA215,76,49,234,160,1150,38,177,253,200
2320 DATA145,253,136,177,1379,251,200,145,251
2330 DATA136,136,192,255,1566,208,239,160,0
2340 DATA169,32,145,253,1206,96,0,0,0,0,0,0,0,96
2350 :
2360 REM ////////////////
2370 REM / DATA CHECKER /
2380 REM ////////////////
2390 :
2400 READA:IFTK=ATHENCK=0:TK=CK:RETURN
2410 POKE53270,PEEK(53270)OR8
2420 LN=PEEK(63)+PEEK(64)*256
2430 PRINT"[147]DATA ERROR IN LINE #";LN
2440 PRINT"CHECK DATA ON THIS LINE OR LINE #"LN-10
2450 END